﻿using System;
using System.Web;
using System.Web.UI.WebControls;
using Business;

namespace ServicesDirectory.UserControl
{
    public partial class ListDirectorate : System.Web.UI.UserControl
    {
        /// <summary>
        /// Occurs when [set data detail6].
        /// </summary>
        public event EventHandler SetDataDetail6;
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                if (SetDataDetail6 != null)
                    SetDataDetail6(sender, e);


        }

        /// <summary>
        /// Displays the specified org id.
        /// </summary>
        /// <param name="orgId">The org id.</param>
        public void Display(Guid orgId)
        {
            var result = DirectorateBusiness.Instance.GetAll(orgId, false);
            Repeater1.DataSource = result;
            Repeater1.DataBind();
        }

        #region Function
        /// <summary>
        /// Handles the ItemCommand event of the Repeater1 control.
        /// </summary>
        /// <param name="source">The source of the event.</param>
        /// <param name="e">The <see cref="CommandEventArgs" /> instance containing the event data.</param>
        protected void Repeater1_ItemCommand(object source, CommandEventArgs e)
        {
            if (e.CommandName == "Edit")
            {
                Session["directorateid"] = e.CommandArgument.ToString();
                Response.Redirect("DetailDirectorate.aspx");
            }
        }

        /// <summary>
        /// Handles the Click event of the BtnCreate control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        /// <exception cref="System.NotImplementedException"></exception>
        protected void BtnCreate_Click(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Handles the Click1 event of the CmdFisrt control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        /// <exception cref="System.NotImplementedException"></exception>
        protected void CmdFisrt_Click1(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Handles the Click1 event of the CmdBack control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        /// <exception cref="System.NotImplementedException"></exception>
        protected void CmdBack_Click1(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Handles the Click1 event of the CmdNext control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        /// <exception cref="System.NotImplementedException"></exception>
        protected void CmdNext_Click1(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Handles the Click1 event of the CmdLast control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        /// <exception cref="System.NotImplementedException"></exception>
        protected void CmdLast_Click1(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }
        #endregion
    }
}